package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CheckInLogMapper;
import com.ruoyi.system.domain.CheckInLog;
import com.ruoyi.system.service.ICheckInLogService;

/**
 * 入退住日志Service业务层处理
 *
 * @author ruoyi
 * @date 2023-02-15
 */
@Service
public class CheckInLogServiceImpl implements ICheckInLogService
{
    @Autowired
    private CheckInLogMapper checkInLogMapper;

    /**
     * 查询入退住日志
     *
     * @param id 入退住日志主键
     * @return 入退住日志
     */
    @Override
    public CheckInLog selectCheckInLogById(Long id)
    {
        return checkInLogMapper.selectCheckInLogById(id);
    }

    /**
     * 查询入退住日志列表
     *
     * @param checkInLog 入退住日志
     * @return 入退住日志
     */
    @Override
    public List<CheckInLog> selectCheckInLogList(CheckInLog checkInLog)
    {
        return checkInLogMapper.selectCheckInLogList(checkInLog);
    }

    /**
     * 新增入退住日志
     *
     * @param checkInLog 入退住日志
     * @return 结果
     */
    @Override
    public int insertCheckInLog(CheckInLog checkInLog)
    {
        checkInLog.setCreateTime(DateUtils.getNowDate());
        return checkInLogMapper.insertCheckInLog(checkInLog);
    }

    /**
     * 修改入退住日志
     *
     * @param checkInLog 入退住日志
     * @return 结果
     */
    @Override
    public int updateCheckInLog(CheckInLog checkInLog)
    {
        checkInLog.setUpdateTime(DateUtils.getNowDate());
        return checkInLogMapper.updateCheckInLog(checkInLog);
    }

    /**
     * 批量删除入退住日志
     *
     * @param ids 需要删除的入退住日志主键
     * @return 结果
     */
    @Override
    public int deleteCheckInLogByIds(Long[] ids)
    {
        return checkInLogMapper.deleteCheckInLogByIds(ids);
    }

    /**
     * 删除入退住日志信息
     *
     * @param id 入退住日志主键
     * @return 结果
     */
    @Override
    public int deleteCheckInLogById(Long id)
    {
        return checkInLogMapper.deleteCheckInLogById(id);
    }
}
